//test
import { selectProjectRecord } from '@/service/Api'
export const increment = ({commit}) => {
    commit('INCREMENT')
}
export const decrement = ({commit}) => {
    commit('DECREMENT')
}
export const add_flag = ({commit},flag) => {
    commit('add_flag',flag)
}
export const getProjectList = ({commit}, data) => {
    new Promise( (resolve, reject) => {
        selectProjectRecord({
            projectId: data.id,
            recordType: '0',
            pn: data.pn,
            ps: data.ps
        }).then(response => {
            if(response.code === 0){
                commit("SET_PROJECT_LIST", response.data.records)
                commit("SET_SIZE", response.data.total)
                resolve()
            }
        }).catch(err => {
            reject(err)
        })
    } )
}
